import { getEncryptPwd } from "utils/helper";
import Axios from "utils/Axios";

//病友圈tab数据
export const patintTabs = () => {
  return Axios.get("/api/health/share/knowledgeBase/v1/findDepartment").then(
    (res) => {
      return res;
    }
  );
};
//tab页面数据
export const patintList = (data: any) => {
  return Axios.get("/api/health/doctor/sickCircle/v1/findSickCircleList", {
    params: { ...data },
  }).then((res) => {
    return res;
  });
};
//病友圈建议页
export const suggetion = (sickCircleId: any) => {
  return Axios.get("/api/health/doctor/sickCircle/v1/findSickCircleInfo", {
    params: { sickCircleId },
  }).then((res) => {
    return res;
  });
};
//发表解答
export const myanswer = (data: any) => {
  return Axios({
    url: "/api/health/doctor/sickCircle/verify/v1/publishComment",
    method: "post",
    params: data,
  });
};
//申请入驻
export const register = (data: any) => {
  const newpwd = getEncryptPwd(data.pwd1);
  data.pwd1 = newpwd as string;
  data.pwd2 = data.pwd1;
  return Axios({
    url: "/api/health/doctor/v1/applyJoin",
    method: "post",
    data,
  });
};
//获取验证码
export const getcode = (email: string) => {
  return Axios.post("/api/health/doctor/v1/sendEmailCode", null, {
    params: { email },
  }).then((res) => {
    return res;
  });
};
